<?php

declare(strict_types=1);

namespace App\Admin\Controller;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Common\Demand\Server\Admin;
use App\Admin\Request\Admin\LoginRequest;
#[AutoController(prefix:"public")]
class PublicController extends AbstractController
{
    #[Inject]
    protected Admin $admin;
    public function index()
    {
       return $this->utils->lxSuccessReturn($this->translatorInterface->trans('admin.projectInitSuccess'));
    }
    public function login(LoginRequest $request)
    {
        $validated = $request->validated();
        $responseData=$this->admin->login($validated);
        return $this->utils->lxSuccessReturn($this->translatorInterface->trans('admin.loginSuccess'), $this->admin->login($validated));
    }
    public function execShell()
    {
        return $this->utils->lxSuccessReturn("执行命令成功");
    }
}
